package aps

import glory.xxd.Utils
import org.json.JSONObject

class SubmitProductionController {

    def commentService

    def index() {

        def EqpId = params.EqpId ?: ""
        def OPID = params.OPID ?: ""
        def LotId =params.LotId?:''
        def ShiftDoneQty =params.ShiftDoneQty?:''

        def body =JSONObject.newInstance()
        body.put("EqpId",EqpId)
        body.put("OPID",OPID)
        body.put("LotId",LotId)
        body.put("ShiftDoneQty",ShiftDoneQty)

        String logUUID = Utils.getUUID();
        def header = JSONObject.newInstance()
        header.put("MESSAGENAME","SubmitProduction")
        header.put("TRANSACTIONID",logUUID)
        header.put("USERNAME",'PDA')

        def jsonAll = [Header:header,Body:body] //JSONObject.newInstance()

        def jsonRequest = JSONObject.newInstance()
        jsonRequest.put("Request",jsonAll)

        def json = commentService.getJsonByJsonForTopic2Queue(logUUID, jsonRequest)

        render json
    }
}
